import { lazy } from "react";
import { Navigate } from "react-router-dom";
const Home = lazy(() => import("../view/Home"));
const Deafult = lazy(() => import("../view/Deafult"));
const Friends = lazy(() => import("../view/Friends"));
const Login = lazy(() => import("../view/User/Login"));
const Video = lazy(() => import("../view/Video"));
const Search = lazy(() => import("../view/Search"));
const Disease = lazy(() => import("../view/Disease"));
const Header = lazy(() => import("../components/Header/Header"));
const HealthDetail = lazy(() => import("../view/HealthDetail"));
const DrugDetail = lazy(() => import("../view/DrugDetail"));

const User = lazy(() => import("../view/User"));
const Sigin = lazy(() => import("../view/User/Sigin"));
const Forget = lazy(() => import("../view/User/Forget"));
const Carousel = lazy(() => import("../view/Carousel"));
const Seek = lazy(() => import("../view/Seek"));
const SearchList = lazy(() => import("../view/SearchList"));
const DoctorList = lazy(() => import("../view/DoctorList"));
// 病友圈详情
const FerId = lazy(() => import("../view/FerId"));
const Friendsseek = lazy(() => import("../view/Friendsseek"));
const Formation = lazy(() => import("../view/Formation"));
const DoctorComments = lazy(() => import("../view/DoctorComments"));
const CommentonJane = lazy(() => import("../view/CommentonJane"));

const DoctorDeatil = lazy(() => import("../view/DoctorDeatil"));

//聊天室
const ChatRroom = lazy(() => import("../view/ChatRroom"));

// 我的
const My = lazy(() => import("../view/My"));
const Archives = lazy(() => import("../view/My/Archives"));
const Collect = lazy(() => import("../view/My/Collect"));
const Community = lazy(() => import("../view/My/Community"));
const Follow = lazy(() => import("../view/My/Follow"));
const Purse = lazy(() => import("../view/My/Purse"));
const Quest = lazy(() => import("../view/My/Quest"));
const Settings = lazy(() => import("../view/My/Settings"));
const Suggestion = lazy(() => import("../view/My/Suggestion"));
const Videotwo = lazy(() => import("../view/My/Video"));
const Current = lazy(() => import("../view/My/Current"));
const History = lazy(() => import("../view/My/History"));
//设置----（个人信息）
const Personaldetails = lazy(() => import("../view/Lnstall/Personaldetails"));
const Changepassword = lazy(() => import("../view/Lnstall/Changepassword"));
const Buffermemory = lazy(() => import("../view/Lnstall/Buffermemory"));
const Screenluminance = lazy(() => import("../view/Lnstall/Screenluminance"));
const Versions = lazy(() => import("../view/Lnstall/Versions"));
const Helpcenter = lazy(() => import("../view/Lnstall/Helpcenter"));
const AboutUs = lazy(() => import("../view/Lnstall/AboutUs"));
const Invitefriends = lazy(() => import("../view/Lnstall/Invitefriends"));


//路由表类型
export interface RouterType {
  path: string;
  name: string;
  element: JSX.Element;
  children?: RouterType[];
}

export const ROuterList: RouterType[] = [
  {
    path: "/deafult",
    name: "主页",
    element: <Deafult></Deafult>,
    children: [
      {
        path: "home",
        name: "首页",
        element: <Home></Home>,
      },

      {
        path: "friends",
        name: "朋友圈",
        element: <Friends></Friends>,
      },
    ],
  },
  {
    path: "/video",
    name: "视频",
    element: <Video></Video>,
  },
  {
    path: "/user",
    name: "用户操作",
    element: <User></User>,
    children: [
      {
        path: "login",
        name: "登录",
        element: <Login></Login>,
      },
      {
        path: "forget",
        name: "忘记密码",
        element: <Forget></Forget>,
      },
      {
        path: "sigin",
        name: "注册",
        element: <Sigin></Sigin>,
      },
    ],
  },
  {
    path: "/my",
    name: "我的",
    element: <My></My>,
  },
  {
    path: "current",
    name: "当前问诊",
    element: <Current></Current>,
  },
  {
    path: "history",
    name: "历史问诊",
    element: <History></History>,
  },
  {
    path: "archives",
    name: "我的档案",
    element: <Archives></Archives>,
  },
  {
    path: "purse",
    name: "我的钱包",
    element: <Purse></Purse>,
  },
  {
    path: "collect",
    name: "我的收藏",
    element: <Collect></Collect>,
  },
  {
    path: "suggestion",
    name: "被采纳建议",
    element: <Suggestion></Suggestion>,
  },
  {
    path: "video",
    name: "我的视频",
    element: <Videotwo></Videotwo>,
  },
  {
    path: "community",
    name: "我的病友圈",
    element: <Community></Community>,
  },
  {
    path: "quest",
    name: "我的任务",
    element: <Quest></Quest>,
  },
  {
    path: "settings",
    name: "我的设置",
    element: <Settings></Settings>,
  },
  {
    path: "personaldetails",
    name: "我的个人信息",
    element: <Personaldetails></Personaldetails>,
  },
  {
    path: "changepassword",
    name: "更改密码",
    element: <Changepassword></Changepassword>,
  },
  {
    path: "buffermemory",
    name: "清楚缓存",
    element: <Buffermemory></Buffermemory>,
  },
  {
    path: "screenluminance",
    name: "屏幕亮度",
    element: <Screenluminance></Screenluminance>,
  },
  {
    path: "versions",
    name: "版本检测",
    element: <Versions></Versions>,
  },
  {
    path: "helpcenter",
    name: "帮助中心",
    element: <Helpcenter></Helpcenter>,
  },
  {
    path: "aboutUs",
    name: "关于我们",
    element: <AboutUs></AboutUs>,
  },
  {
    path:'invitefriends',
    name:'邀请好友',
    element:<Invitefriends></Invitefriends>
  },
  {
    path: "follow",
    name: "我的关注",
    element: <Follow></Follow>,
  },
  
  {
    path: "/search",
    name: "搜索页",
    element: <Search></Search>,
  },
  {
    path: "ferid/:id",
    name: "病友圈详情",
    element: <FerId></FerId>,
  },
  {
    path: "Friendsseek",
    name: "病友圈搜索",
    element: <Friendsseek></Friendsseek>,
  },
  {
    path: "Formation/:id",
    name: "用户信息",
    element: <Formation></Formation>,
  },
  {
    path: "/seek/:infoId",
    name: "咨询详情",
    element: <Seek></Seek>,
  },

  {
    path: "/header",
    name: "头部",
    element: <Header></Header>,
  },
  {
    path: "/searchList",
    name: "搜索列表",
    element: <SearchList></SearchList>,
  },
  {
    path: "/doctorComments/:id",
    name: "医生评论",
    element: <DoctorComments></DoctorComments>,
  },
  {
    path: "/CommentonJane",
    name: "评价问珍",
    element: <CommentonJane></CommentonJane>,
  },
  // {
  //   path: "/",
  //   name: "轮播页面",
  //   element: <Carousel></Carousel>,
  // },
  {
        path:'/disease',
        name:'常见病症',
        element:<Disease></Disease>
    },
   {
        path:'/healthDetail/:id',
        name:'健康详情',
        element:<HealthDetail></HealthDetail>
    },
      {
        path:'/drugDetail/:id',
        name:'药品',
        element:<DrugDetail></DrugDetail>
    },
        {
        path:'/doctorList',
        name:'医生列表',
        element:<DoctorList></DoctorList>
    },
        {
        path:'/doctor/:id',
        name:'医生详情',
        element:<DoctorDeatil></DoctorDeatil>
    },
        {
        path:'/chatRroom',
        name:'聊天室',
        element:<ChatRroom></ChatRroom>
    },
 

  {
    path: "/",
    name: "重定向",
    element: <Navigate to="/deafult/home"></Navigate>,
  },
];
